﻿using System.Collections.Generic;
using BO;
using Model;

namespace Controller
{
    /// <summary>
    /// Summary description for PostController
    /// </summary>
    public class PostController
    {
        private PostBO postBo;

        public PostController()
        {            
            postBo = new PostBO();
        }

        /// <summary>
        /// Get list post
        /// </summary>
        /// <returns></returns>
        public List<Post> GetListPost()
        {
            return postBo.GetListPosts();
        }

        /// <summary>
        /// Add new post
        /// </summary>
        /// <param name="post"></param>
        /// <returns></returns>
        public int AddPost(Post post)
        {
            return postBo.AddPost(post);
        }

        /// <summary>
        /// Edit post
        /// </summary>
        /// <param name="post"></param>
        /// <returns></returns>
        public int EditPost(Post post)
        {
            return postBo.EditPost(post);
        }

        /// <summary>
        /// Delete post
        /// </summary>
        /// <param name="post"></param>
        /// <returns></returns>
        public int DeletePost(Post post)
        {
            return postBo.DeletePost(post);
        }

        public List<Post> FindPostbyUniqueId(string uniqueId)
        {
            return postBo.FindPostbyUniqueId(uniqueId);
        }

        public List<Post> FindPostById(string id)
        {
            return postBo.FindPostById(id);
        }

        public int UpdateView(Post post)
        {
            return postBo.UpdateView(post);
        }

        public List<Post> GetListPostsPopularByView()
        {
            return postBo.GetListPostsPopularByView();
        }

        public List<Post> GetListPostsByIdCategory(string idCat)
        {
            return postBo.GetListPostsByIdCategory(idCat);
        }
    }
}